﻿
using HIS;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace Acme.BookStore.RBACIServices
{
    /// <summary>
    /// 用户接口
    /// </summary>
    public interface UserIServices
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="UserName">用户名称</param>
        /// <param name="UserPassword">用户密码</param>
        /// <returns>返回任务</returns>
        Task<APIResult<LoginUserDTO>> Login(string UserNickname, string UserPassword);
        /// <summary>
        /// 添加用户信息
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> AddUser(UserInfoDTO userInfo);
        /// <summary>
        /// 修改用户信息
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> UpdateUser(UserInfoDTO userInfo);
        /// <summary>
        /// 查询用户信息
        /// </summary>
        /// <param name="UserNickname">用户昵称</param>
        /// <param name="UserName">用户名</param>
        /// <returns>返回任务</returns>
        Task<APIResult<List<UserInfoDTO>>> GetUser(string? UserNickname, string? UserName);
        /// <summary>
        /// 添加角色
        /// </summary>
        /// <param name="roleDTO">角色信息</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> AddRole(RoleDTO roleDTO);
        /// <summary>
        /// 添加权限
        /// </summary>
        /// <param name="perDTO">权限信息</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> AddPer(PermissionsDTO perDTO);
        /// <summary>
        /// 用户分配角色
        /// </summary>
        /// <param name="UserId">用户Id</param>
        /// <param name="RoleId">角色Id</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> UserAllocationRole(int UserId, int RoleId);
        /// <summary>
        /// 角色分配权限
        /// </summary>
        /// <param name="RoleId">角色Id</param>
        /// <param name="PerId">权限Id</param>
        /// <returns>返回任务</returns>
        Task<APIResult<object>> RoleAllocationPer(int RoleId, int PerId);
    }
}
